package com.initialize.commom.config.security;

import com.initialize.commom.config.service.ServiceConfig;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: jane
 * Date: 2020/1/4
 * Time: 3:19 下午
 * Description: Security默认的拦截配置
 */
public class SecurityRequestConfig {

    /**
     * 安全请求
     */
    public List<String> securityRequestList = new ArrayList<>();

    /**
     * 权限请求
     */
    public Map<String, String> competenceRequestList = new LinkedHashMap<>();


    /**
     * 初始化安全请求
     */ {
        securityRequestList.add("/service-system/user/port");
        securityRequestList.add("/service-system/user/findByUsername");
        securityRequestList.add("/user/findByUsername");
        securityRequestList.add("/user-api/login");
//        securityRequestList.add("/user/port");
        securityRequestList.add("/auth/**");
        securityRequestList.add("/" + ServiceConfig.SERVICE_AUTH + "/auth/**");
    }

    /**
     * 初始化权限请求
     */ {
        competenceRequestList.put("/user-api/user-info", "USER");
    }



    public List<String> getSecurityRequestList() {
        return securityRequestList;
    }

    public void setSecurityRequestList(List<String> securityRequestList) {
        this.securityRequestList = securityRequestList;
    }

    public Map<String, String> getCompetenceRequestList() {
        return competenceRequestList;
    }

    public void setCompetenceRequestList(Map<String, String> competenceRequestList) {
        this.competenceRequestList = competenceRequestList;
    }

}